Most IC cards used as portable electronic apparatuses have a main body and an IC module. The main body is made of plastics and shaped like a card. The IC module is embedded in the main body and has an IC chip. The IC chip has a nonvolatile memory, a volatile memory, and a CPU. The nonvolatile memory that can hold data even if it is not supplied with power is, for example, an electrically erasable programmable read-only memory (EEPROM) or a flash ROM. The volatile memory is, for example, a RAM. The CPU performs various operations.
The IC card is one that accords with the International Standards ISO/IEC7816. The IC card has a master file (MF), which is the basis of the file structure and which is stored in the nonvolatile memory. The IC card also has a dedicated file (DF), which is a lower file with respect to the MF and is used to group applications or the like. The IC card further has an elementary file (EF), which is a lower file with respect to the MF or the MF and is used to hold various data items.
The International Standards ISO/IEC7816 defines a file structure for the MF, DF and EF, or tag-length value (TLV) type data (TLV data object). The TLV data object has data class (Tag), data length (Length) and data character (Value).
Tag of the TLV data object is a data item the CPU of the IC card uses to identify the class of the TLV data object. Length of the TLV data object is a data item that represents the length of Value of the TLV data object. Value is the main part of the TLV data object.
The International Standards ISO/IEC7816-4, cited herein as Non-Patent Document 1, defines various commands designating processes to be performed on the IC card. One of these commands is GET DATA command that is used to read any desired TLV data object from the file.
The GET DATA command has a data item (designation data) that designates a TLV data object. On receiving the GET DATA command, the IC card retrieves from the file the TLV data object that has a Tag identical to the designation data contained in the GET DATA command.
However, the TLV data object does not have a prescribed length. It inevitably takes much time to retrieve any data desired. If the file contains a plurality of TLV data objects coupled one to another, the CPU of the IC card collates the designation data with the Tag stored at the head of the storage area.
If the Tag stored at the head of the storage area is not identical to the designation data is not identical, the CPU moves the data pointer (reading position) by the distance represented by the Length recorded after the Tag. The CPU then collates the designation data with the Tag stored at the position to which the data pointer has been moved. The CPU repeats this sequence of process until it finds Tag identical to the designation data.